package com.turing.data.scripts.contract.transfer

import com.turing.data.vo.out.review.DependParamsVO
import com.turing.data.vo.out.review.TaskElementVO


/*
调节方式
* */

class ControlMode_30205_10_transfer {

    static List< TaskElementVO.DrawResultVO > doConvert(List< TaskElementVO.DrawResultVO > resultVOs, DependParamsVO dependParams){

        def REGEX_NEG = ".*协商.*"
        def REGEX_ARB = ".*仲裁.*"
        def REGEX_LIT = ".*法院.*"
        if (resultVOs!=null && resultVOs.size()>0){
            for (int i = 0; i < resultVOs.size(); i++) {
                def childTaskSn = resultVOs.get(i).childTaskSn
                if(null == childTaskSn || childTaskSn == ""){
                    continue
                }
                String modelValue = resultVOs.get(i).getText()
                if (modelValue != null && modelValue != "") {
                    if(modelValue =~ REGEX_NEG){
                        resultVOs.get(i).setBusinessValue("协商调解")
                        resultVOs.get(i).setType(1)
                    }else if( modelValue =~ REGEX_ARB  ){
                        resultVOs.get(i).setBusinessValue("向仲裁机构仲裁")
                        resultVOs.get(i).setType(1)
                    }else if(modelValue =~ REGEX_LIT){
                        resultVOs.get(i).setBusinessValue("向人民法院起诉")
                        resultVOs.get(i).setType(1)
                    }
                }else {
                    resultVOs.get(i).setBusinessValue("其他")
                    resultVOs.get(i).setType(1)
                }
            }
        }

        return resultVOs
    }


}
